<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>test()方法搜索字符串指定的值根据结果并返回真或假</title>
</head>

<body>
    <script>
        var patt1 = new RegExp("e");
        document.write(patt1.test("The best things in life are free"));
    </script>
</body>

</html>